<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="imlgw,半岛铁盒,blog,Java博客,程序员,个人博客,java開發,程序員,個人博客,Java">
    <meta name="description" content="大悲无泪，大悟无言，大笑无声。">
    <meta name="author" content="Resolmi">
    
    <title>
        
            数据库大作业 |
        
        Tadow
    </title>
    
<link rel="stylesheet" href="/css/style.css">

    <link rel="shortcut icon" href="https://static.imlgw.top/blog/20210731/BtJz541CcmJU.ico">
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/css/font-awesome.min.css">
    <script id="hexo-configurations">
    let KEEP = window.KEEP || {};
    KEEP.hexo_config = {"hostname":"imlgw.top","root":"/","language":"zh-CN","path":"search.json"};
    KEEP.theme_config = {"toc":{"enable":true,"number":true,"expand_all":true,"init_open":true},"style":{"primary_color":"#0066CC","avatar":"https://static.imlgw.top/blog/20210731/3C7hCSRR3lfq.png","favicon":"https://static.imlgw.top/blog/20210731/BtJz541CcmJU.ico","article_img_align":"left","left_side_width":"260px","content_max_width":"920px","hover":{"shadow":false,"scale":true},"first_screen":{"enable":true,"background_img":"/images/image.svg","description":"Keep It Simple & Stupid."},"scroll":{"progress_bar":{"enable":true},"percent":{"enable":true}}},"local_search":{"enable":true,"preload":false},"code_copy":{"enable":true,"style":"default"},"pjax":{"enable":true},"lazyload":{"enable":true},"version":"3.4.3"};
    KEEP.language_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 月前","year":"%s 年前"};
  </script>
<meta name="generator" content="Hexo 5.4.0"><link rel="stylesheet" href="/css/prism.css" type="text/css"></head>


<body>
<div class="progress-bar-container">
    
        <span class="scroll-progress-bar"></span>
    

    
        <span class="pjax-progress-bar"></span>
        <span class="pjax-progress-icon">
            <i class="fas fa-circle-notch fa-spin"></i>
        </span>
    
</div>


<main class="page-container">

    

    <div class="page-main-content">

        <div class="page-main-content-top">
            <header class="header-wrapper">

    <div class="header-content">
        <div class="left">
            
            <a class="logo-title" href="/">
                Tadow
            </a>
        </div>

        <div class="right">
            <div class="pc">
                <ul class="menu-list">
                    
                        <li class="menu-item">
                            <a class=""
                               href="/"
                            >
                                首页
                            </a>
                        </li>
                    
                        <li class="menu-item">
                            <a class=""
                               href="/archives"
                            >
                                归档
                            </a>
                        </li>
                    
                        <li class="menu-item">
                            <a class=""
                               href="/categories"
                            >
                                分类
                            </a>
                        </li>
                    
                        <li class="menu-item">
                            <a class=""
                               href="/sbe"
                            >
                                订阅
                            </a>
                        </li>
                    
                        <li class="menu-item">
                            <a class=""
                               href="/links"
                            >
                                友链
                            </a>
                        </li>
                    
                        <li class="menu-item">
                            <a class=""
                               href="/about"
                            >
                                关于
                            </a>
                        </li>
                    
                    
                        <li class="menu-item search search-popup-trigger">
                            <i class="fas fa-search"></i>
                        </li>
                    
                </ul>
            </div>
            <div class="mobile">
                
                    <div class="icon-item search search-popup-trigger"><i class="fas fa-search"></i></div>
                
                <div class="icon-item menu-bar">
                    <div class="menu-bar-middle"></div>
                </div>
            </div>
        </div>
    </div>

    <div class="header-drawer">
        <ul class="drawer-menu-list">
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/">首页</a>
                </li>
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/archives">归档</a>
                </li>
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/categories">分类</a>
                </li>
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/sbe">订阅</a>
                </li>
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/links">友链</a>
                </li>
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/about">关于</a>
                </li>
            
        </ul>
    </div>

    <div class="window-mask"></div>

</header>


        </div>

        <div class="page-main-content-middle">

            <div class="main-content">

                
                    <div class="fade-in-down-animation">
    <div class="article-content-container">

        <div class="article-title">
            <span class="title-hover-animation">数据库大作业</span>
        </div>

        
            <div class="article-header">
                <div class="avatar">
                    <img src="https://static.imlgw.top/blog/20210731/3C7hCSRR3lfq.png">
                </div>
                <div class="info">
                    <div class="author">
                        <span class="name">Resolmi</span>
                        
                            <span class="author-label">BOSS</span>
                        
                    </div>
                    <div class="meta-info">
                        <div class="article-meta-info">
    <span class="article-date article-meta-item">
        <i class="fas fa-edit"></i>&nbsp;2019-05-20 00:00:00
    </span>
    
        <span class="article-categories article-meta-item">
            <i class="fas fa-folder"></i>&nbsp;
            <ul>
                
                    <li>
                        <a href="/categories/%E5%B7%A5%E5%85%B7/">工具</a>&nbsp;
                    </li>
                
            </ul>
        </span>
    
    
        <span class="article-tags article-meta-item">
            <i class="fas fa-tags"></i>&nbsp;
            <ul>
                
                    <li>
                        <a href="/tags/%E5%B7%A5%E5%85%B7/">工具</a>&nbsp;
                    </li>
                
            </ul>
        </span>
    

    
    
        <span class="article-wordcount article-meta-item">
            <i class="fas fa-file-word"></i>&nbsp;<span>1.5k 字</span>
        </span>
    
    
        <span class="article-min2read article-meta-item">
            <i class="fas fa-clock"></i>&nbsp;<span>6 分钟</span>
        </span>
    
    
        <span class="article-pv article-meta-item">
            <i class="fas fa-eye"></i>&nbsp;<span id="busuanzi_value_page_pv"></span>
        </span>
    
</div>

                    </div>
                </div>
            </div>
        

        <div class="article-content markdown-body">
            <h2 id="准备工作"><a href="#准备工作" class="headerlink" title="准备工作"></a>准备工作</h2><h3 id="环境"><a href="#环境" class="headerlink" title="环境"></a>环境</h3><ul>
<li>JDK(建议1.8以上)</li>
<li>开发工具，Eclipse或者idea …</li>
<li><strong>mysql</strong>或者<strong>mssql</strong>(我是用的<strong>mysql5.7.17</strong>，给的demo是mysql的)</li>
</ul>
<h3 id="测试给的Demo"><a href="#测试给的Demo" class="headerlink" title="测试给的Demo"></a>测试给的Demo</h3><p>①装好mysql之后启动它，然后用管理工具我用的是<strong>navicat</strong>，打开然后将给的demo里面的sql脚本导入进去(导入不好的可以手动建立一个，用脚本文件导入后的名字是tb_demo，我这里是手动建的)</p>
<p><video controls="controls" src="http://static.imlgw.top/image/20190530/M2IOTaKdyaQO.mp4" width="100%"></video></p>
<p><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="http://static.imlgw.top/image/20190524/oNHeEFJhHEYX.png?imageslim"
                      alt="mark"
                ></p>
<p>最后差不多是这样的结构</p>
<p>②在<strong>Eclipse</strong>里面<strong>import</strong>项目，这里我<strong>import</strong>会有个感叹号，<strong>最好重新建一个项目，不然可能会有奇怪的错误</strong>下面是<strong>如何新建的步骤视频</strong></p>
<p><video controls="controls" src="http://static.imlgw.top/f0xim-iyaow.mp4" width="100%"></video></p>
<p>这里要改的地方就是DbUtil里面数据库配置</p>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">DbUtil</span> </span>&#123;</span><br><span class="line">	<span class="comment">//com.microsoft.sqlserver.jdbc.SQLServerDriver</span></span><br><span class="line">    <span class="comment">//数据库驱动的名字（1.6还是1.8之后就不需要了，这里还是加上吧）</span></span><br><span class="line">	String driverName = <span class="string">&quot;com.mysql.jdbc.Driver&quot;</span>;</span><br><span class="line">	<span class="comment">//jdbc:sqlserver://127.0.0.1:1433;DatabaseName=demo</span></span><br><span class="line">    <span class="comment">//连接数据库的地址，前面的不用改，这里要改的就是后面的 demo 换成你的数据库名字（我上面的是demo）</span></span><br><span class="line">	String dbURL = <span class="string">&quot;jdbc:mysql://localhost:3306/demo&quot;</span>;</span><br><span class="line">    <span class="comment">//你的数据库的帐号</span></span><br><span class="line">	String userName = <span class="string">&quot;root&quot;</span>;</span><br><span class="line">    <span class="comment">//装mysql时设置的密码</span></span><br><span class="line">	String userPwd = <span class="string">&quot;admin&quot;</span>; </span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> Connection <span class="title">getCon</span><span class="params">()</span> <span class="keyword">throws</span> ClassNotFoundException, SQLException </span>&#123;</span><br><span class="line">		Class.forName(driverName);</span><br><span class="line">		Connection conn = DriverManager.getConnection(dbURL, userName, userPwd);</span><br><span class="line">		<span class="keyword">return</span> conn;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">closeCon</span><span class="params">(Connection conn)</span> <span class="keyword">throws</span> SQLException </span>&#123;</span><br><span class="line">		<span class="keyword">if</span> (conn != <span class="keyword">null</span>)</span><br><span class="line">			conn.close();</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">		DbUtil dbUtil = <span class="keyword">new</span> DbUtil();</span><br><span class="line">		<span class="keyword">try</span> &#123;</span><br><span class="line">			dbUtil.getCon();</span><br><span class="line">			System.out.println(<span class="string">&quot;连接成功&quot;</span>);</span><br><span class="line">		&#125; <span class="keyword">catch</span> (Exception e) &#123;</span><br><span class="line">			e.printStackTrace();</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h4 id="注意事项"><a href="#注意事项" class="headerlink" title="注意事项"></a>注意事项</h4><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="comment">//com.microsoft.sqlserver.jdbc.SQLServerDriver</span></span><br><span class="line">   <span class="comment">//数据库驱动的名字（1.6还是1.8之后就不需要了，这里还是加上吧）</span></span><br><span class="line">String driverName = <span class="string">&quot;com.mysql.jdbc.Driver&quot;</span>;</span><br><span class="line"><span class="comment">//jdbc:sqlserver://127.0.0.1:1433;DatabaseName=demo</span></span><br><span class="line">   <span class="comment">//连接数据库的地址，这里要改的就是后面的 demo 换成你的数据库名字（我上面的是demo）</span></span><br><span class="line">String dbURL = <span class="string">&quot;jdbc:mysql://localhost:3306/demo&quot;</span>;</span><br><span class="line">   <span class="comment">//你的数据库的帐号</span></span><br><span class="line">String userName = <span class="string">&quot;root&quot;</span>;</span><br><span class="line">   <span class="comment">//密码</span></span><br><span class="line">String userPwd = <span class="string">&quot;admin&quot;</span>; </span><br></pre></td></tr></table></figure>

<p>要改的差不多就是这4个配置</p>
<p>①如果是<strong>mysql</strong>并且版本是8以下的，那么<strong>driverName</strong> 可以不用改，如果是8以上的（群里面那个是8以上的）就需要改成</p>
<p><strong>com.mysql.cj.jdbc.Driver</strong>，并且<strong>找到适合版本的驱动拷贝到lib目录然后右键bulidpath</strong>（在这之前先将老的驱动删掉，bulidpath的作用是将jar包<strong>真正的</strong>加到你的项目中去）</p>
<ul>
<li><p>8 以上 驱动下载地址 链接：<a class="link"   target="_blank" rel="noopener" href="https://pan.baidu.com/s/1WXjAAHX5gQC6v5pfiTOqmQ" >https://pan.baidu.com/s/1WXjAAHX5gQC6v5pfiTOqmQ<i class="fas fa-external-link-alt"></i></a>  提取码：5lf5 </p>
</li>
<li><p>sqlServer需要改的地方我也注释在上面但是我电脑上没sqlserver我没有测试，老师给的包里面有sqlserver的驱动</p>
</li>
</ul>
<p>②<strong>dbURL</strong>，前面的不用改，这里只需要改一下后面的数据库名字，比如我上面建的数据库名字是<strong>demo</strong>,后面就应该是/demo（如果用脚本直接导入生成的数据库名字是db_demo，这里就要改成jdbc:mysql://localhost:3306/db_demo</p>
<ul>
<li>对应sqlserver的我也放在上面但是我没装sqlserver所以没测试。</li>
</ul>
<p>③<strong>userName</strong>，数据库账号（一般默认就是root）</p>
<p>④<strong>password</strong>，数据库密码</p>
<h3 id="启动"><a href="#启动" class="headerlink" title="启动"></a>启动</h3><p>在view包下的<strong>MainPage</strong>，这是用java的swing组件开发的一个GUI页面，最下面有一个main函数直接启动它就行，（如果有乱码，需要将eclipes的工作空间的编码方式换为<strong>utf-8</strong>），到此环境就基本ok了，后面的就是写代码的事了。</p>
<h3 id="改用自己的数据库"><a href="#改用自己的数据库" class="headerlink" title="改用自己的数据库"></a>改用自己的数据库</h3><blockquote>
<p>后面的部分主要是代码的问题了，每个人数据库不同也会有一些差距</p>
</blockquote>
<ul>
<li><p>导入自己的数据</p>
<p>数据库名字，字段名不要用中文！</p>
<p>数据库名字，字段名不要用中文 ！</p>
<p>数据库名字，字段名不要用中文！</p>
</li>
<li><p>实体类改成自己的</p>
</li>
</ul>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="keyword">import</span> java.util.Date;</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">StuInfo</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">private</span> Long stuId;</span><br><span class="line">	<span class="keyword">private</span> String stuName;</span><br><span class="line">	<span class="keyword">private</span> String stuSex;</span><br><span class="line">	<span class="keyword">private</span> Date stuDob;</span><br><span class="line">	<span class="keyword">private</span> String stuMajor;</span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">public</span> Long <span class="title">getStuId</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		<span class="keyword">return</span> stuId;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setStuId</span><span class="params">(Long stuId)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">this</span>.stuId = stuId;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> String <span class="title">getStuName</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		<span class="keyword">return</span> stuName;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setStuName</span><span class="params">(String stuName)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">this</span>.stuName = stuName;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> String <span class="title">getStuSex</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		<span class="keyword">return</span> stuSex;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setStuSex</span><span class="params">(String stuSex)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">this</span>.stuSex = stuSex;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> Date <span class="title">getStuDob</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		<span class="keyword">return</span> stuDob;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setStuDob</span><span class="params">(Date stuDob)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">this</span>.stuDob = stuDob;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> String <span class="title">getStuMajor</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		<span class="keyword">return</span> stuMajor;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setStuMajor</span><span class="params">(String stuMajor)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">this</span>.stuMajor = stuMajor;</span><br><span class="line">	&#125;</span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="title">StuInfo</span><span class="params">()</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="title">StuInfo</span><span class="params">(String stuName, String stuSex, Date stuDob, String stuMajor)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">this</span>.stuName = stuName;</span><br><span class="line">		<span class="keyword">this</span>.stuSex = stuSex;</span><br><span class="line">		<span class="keyword">this</span>.stuDob = stuDob;</span><br><span class="line">		<span class="keyword">this</span>.stuMajor = stuMajor;</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>这里实体类是和数据库的表和字段对应的，一个StuInfo对象就对应一条数据。</p>
<ul>
<li>增删改查的修改</li>
</ul>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">UserDao</span> </span>&#123;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> ResultSet <span class="title">getUsers</span><span class="params">(User user, Connection con)</span> <span class="keyword">throws</span> SQLException </span>&#123;</span><br><span class="line">		StringBuffer sql = <span class="keyword">new</span> StringBuffer(<span class="string">&quot;select * from t_user &quot;</span>);</span><br><span class="line">		<span class="keyword">if</span> (user.getUserName()!= <span class="keyword">null</span>) &#123;</span><br><span class="line">			sql.append(<span class="string">&quot; where userName like &#x27;%&quot;</span>+user.getUserName()+<span class="string">&quot;%&#x27;&quot;</span>);</span><br><span class="line">		&#125;</span><br><span class="line">		PreparedStatement ps = con.prepareStatement(sql.toString());</span><br><span class="line">		<span class="keyword">return</span> ps.executeQuery();</span><br><span class="line">	&#125;</span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">int</span> <span class="title">delete</span><span class="params">(User user, Connection con)</span> <span class="keyword">throws</span> SQLException</span>&#123;</span><br><span class="line">		String sql=<span class="string">&quot;delete from t_user where userName=&#x27;&quot;</span>+user.getUserName()+<span class="string">&quot;&#x27;&quot;</span>;</span><br><span class="line">		PreparedStatement ps = con.prepareStatement(sql);</span><br><span class="line">		<span class="keyword">return</span> ps.executeUpdate();</span><br><span class="line">	&#125;</span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">int</span> <span class="title">add</span><span class="params">(User user, Connection con)</span> <span class="keyword">throws</span> SQLException</span>&#123;</span><br><span class="line">		String sql=<span class="string">&quot;insert into t_user  values(?,?)&quot;</span>;</span><br><span class="line">		PreparedStatement ps = con.prepareStatement(sql);</span><br><span class="line">		ps.setString(<span class="number">1</span>, user.getUserName());</span><br><span class="line">		ps.setString(<span class="number">2</span>, user.getTel());</span><br><span class="line">		<span class="keyword">return</span> ps.executeUpdate();</span><br><span class="line">	&#125;</span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">int</span> <span class="title">modify</span><span class="params">(User user, Connection con)</span> <span class="keyword">throws</span> SQLException</span>&#123;</span><br><span class="line">		String sql=<span class="string">&quot;update t_user  set userName=?, tel=? where userName = &#x27;&quot;</span>+user.getUserName()+<span class="string">&quot;&#x27;&quot;</span>;</span><br><span class="line">		PreparedStatement ps = con.prepareStatement(sql);</span><br><span class="line">		ps.setString(<span class="number">1</span>, user.getUserName());</span><br><span class="line">		ps.setString(<span class="number">2</span>, user.getTel());</span><br><span class="line">		System.out.println(sql);</span><br><span class="line">		<span class="keyword">return</span> ps.executeUpdate();</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>最终都是通过调用这个Dao类实现的增删改查。</p>
<ul>
<li>页面的修改</li>
</ul>
<p>按照老师的要求是对我们常用的数据库做增删改查，因为我们用的数据库和给的demo的表结构不一样，所以需要修改MainPage，这个是用java的swing写的一个GUI，所以需要改这些界面上的一些元素，我记的好像有个插件可以直接拖动生成swing这些界面的(看见刘勇用过)，我对swing不熟悉（早就过时了，没有学的意义），我用web写的界面</p>
<p><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="http://static.imlgw.top/image/20190530/96gB7wwVz4Xj.png?imageslim"
                      alt="mark"
                ></p>
<h3 id="Mysql"><a href="#Mysql" class="headerlink" title="Mysql"></a>Mysql</h3><p><a class="link"   target="_blank" rel="noopener" href="https://blog.csdn.net/mr_green1024/article/details/53222526?tdsourcetag=s_pcqq_aiomsg" >Mysql5.7解压版的安装和卸载及常见问题<i class="fas fa-external-link-alt"></i></a></p>

        </div>

        
            <div class="post-copyright-info">
                <div class="article-copyright-info-container">
    <ul>
        <li>本文标题：数据库大作业</li>
        <li>本文作者：Resolmi</li>
        <li>创建时间：2019-05-20 00:00:00</li>
        <li>
            本文链接：https://imlgw.top/2019/05/20/bc749bca/
        </li>
        <li>
            版权声明：本博客所有文章除特别声明外，均采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">BY-NC-SA</a> 许可协议。转载请注明出处！
        </li>
    </ul>
</div>

            </div>
        

        
            <div class="article-nav">
                
                    <div class="article-prev">
                        <a class="prev"
                           rel="prev"
                           href="/2019/05/20/a28427/"
                        >
                            <span class="left arrow-icon flex-center">
                              <i class="fas fa-chevron-left"></i>
                            </span>
                            <span class="title flex-center">
                                <span class="post-nav-title-item">WebMvcConfigurer小结</span>
                                <span class="post-nav-item">上一篇</span>
                            </span>
                        </a>
                    </div>
                
                
                    <div class="article-next">
                        <a class="next"
                           rel="next"
                           href="/2019/05/13/e9f4032f/"
                        >
                            <span class="title flex-center">
                                <span class="post-nav-title-item">JSR303-参数检验</span>
                                <span class="post-nav-item">下一篇</span>
                            </span>
                            <span class="right arrow-icon flex-center">
                              <i class="fas fa-chevron-right"></i>
                            </span>
                        </a>
                    </div>
                
            </div>
        

        
            <div class="comment-container">
                <div class="comments-container">
    <div id="comment-anchor"></div>
    <div class="comment-area-title">
        <i class="fas fa-comments">&nbsp;评论</i>
    </div>
    

        
            <section class="disqus-comments">
<div id="disqus_thread">
  <noscript>Please enable JavaScript to view the <a target="_blank" rel="noopener" href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
</section>

<script>
var disqus_shortname = 'imlgw';

var disqus_url = 'https://imlgw.top/2019/05/20/bc749bca/';

(function(){
  var dsq = document.createElement('script');
  dsq.type = 'text/javascript';
  dsq.async = true;
  dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>

<script id="dsq-count-scr" src="//imlgw.disqus.com/count.js" async></script>
        
    
</div>

            </div>
        
    </div>
</div>


                
            </div>

        </div>

        <div class="page-main-content-bottom">
            <footer class="footer">
    <div class="info-container">
        <div class="copyright-info info-item">
            &copy;
            
              <span>2018</span>&nbsp;-&nbsp;
            
            2021&nbsp;<i class="fas fa-heart icon-animate"></i>&nbsp;<a href="/">Resolmi</a>
        </div>
        
            <script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
            <div class="website-count info-item">
                
                    <span id="busuanzi_container_site_uv">
                        访问人数&nbsp;<span id="busuanzi_value_site_uv"></span>&ensp;
                    </span>
                
                
                    <span id="busuanzi_container_site_pv">
                        总访问量&nbsp;<span id="busuanzi_value_site_pv"></span>
                    </span>
                
            </div>
        
        
            <div class="icp-info info-item"><a target="_blank" rel="nofollow" href="https://beian.miit.gov.cn">鄂ICP备18011208号</a></div>
        
    </div>
</footer>

        </div>
    </div>

    
        <div class="post-tools">
            <div class="post-tools-container">
    <ul class="tools-list">
        <!-- TOC aside toggle -->
        
            <li class="tools-item page-aside-toggle">
                <i class="fas fa-outdent"></i>
            </li>
        

        <!-- go comment -->
        
            <li class="go-comment">
                <i class="fas fa-comment"></i>
            </li>
        
    </ul>
</div>

        </div>
    

    <div class="right-bottom-side-tools">
        <div class="side-tools-container">
    <ul class="side-tools-list">
        <li class="tools-item tool-font-adjust-plus flex-center">
            <i class="fas fa-search-plus"></i>
        </li>

        <li class="tools-item tool-font-adjust-minus flex-center">
            <i class="fas fa-search-minus"></i>
        </li>

        <li class="tools-item tool-expand-width flex-center">
            <i class="fas fa-arrows-alt-h"></i>
        </li>

        <li class="tools-item tool-dark-light-toggle flex-center">
            <i class="fas fa-moon"></i>
        </li>

        <!-- rss -->
        

        

        <li class="tools-item tool-scroll-to-bottom flex-center">
            <i class="fas fa-arrow-down"></i>
        </li>
    </ul>

    <ul class="exposed-tools-list">
        <li class="tools-item tool-toggle-show flex-center">
            <i class="fas fa-cog fa-spin"></i>
        </li>
        
            <li class="tools-item tool-scroll-to-top flex-center">
                <i class="arrow-up fas fa-arrow-up"></i>
                <span class="percent"></span>
            </li>
        
    </ul>
</div>

    </div>

    
        <aside class="page-aside">
            <div class="post-toc-wrap">
    <div class="post-toc">
        <ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C"><span class="nav-number">1.</span> <span class="nav-text">准备工作</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%8E%AF%E5%A2%83"><span class="nav-number">1.1.</span> <span class="nav-text">环境</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%B5%8B%E8%AF%95%E7%BB%99%E7%9A%84Demo"><span class="nav-number">1.2.</span> <span class="nav-text">测试给的Demo</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9"><span class="nav-number">1.2.1.</span> <span class="nav-text">注意事项</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%90%AF%E5%8A%A8"><span class="nav-number">1.3.</span> <span class="nav-text">启动</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%94%B9%E7%94%A8%E8%87%AA%E5%B7%B1%E7%9A%84%E6%95%B0%E6%8D%AE%E5%BA%93"><span class="nav-number">1.4.</span> <span class="nav-text">改用自己的数据库</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Mysql"><span class="nav-number">1.5.</span> <span class="nav-text">Mysql</span></a></li></ol></li></ol>
    </div>
</div>
        </aside>
    

    <div class="image-viewer-container">
    <img src="">
</div>


    
        <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
          <span class="search-input-field-pre">
            <i class="fas fa-keyboard"></i>
          </span>
            <div class="search-input-container">
                <input autocomplete="off"
                       autocorrect="off"
                       autocapitalize="off"
                       placeholder="搜索..."
                       spellcheck="false"
                       type="search"
                       class="search-input"
                >
            </div>
            <span class="popup-btn-close">
                <i class="fas fa-times"></i>
            </span>
        </div>
        <div id="search-result">
            <div id="no-result">
                <i class="fas fa-spinner fa-pulse fa-5x fa-fw"></i>
            </div>
        </div>
    </div>
</div>

    

</main>



<script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/utils.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/main.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/header-shrink.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/back2top.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/dark-light-toggle.js"></script>


    <script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/local-search.js"></script>



    <script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/code-copy.js"></script>



    <script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/lazyload.js"></script>


<div class="post-scripts pjax">
    
        <script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/left-side-toggle.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/libs/anime.min.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/toc.js"></script>
    
</div>


    <script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/libs/pjax.min.js"></script>
<script>
    window.addEventListener('DOMContentLoaded', () => {
        window.pjax = new Pjax({
            selectors: [
                'head title',
                '.page-container',
                '.pjax'
            ],
            history: true,
            debug: false,
            cacheBust: false,
            timeout: 0,
            analytics: false,
            currentUrlFullReload: false,
            scrollRestoration: false,
            // scrollTo: true,
        });

        document.addEventListener('pjax:send', () => {
            KEEP.utils.pjaxProgressBarStart();
        });

        document.addEventListener('pjax:complete', () => {
            KEEP.utils.pjaxProgressBarEnd();
            window.pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'));
            KEEP.refresh();
        });
    });
</script>



<script src="https://cdn.jsdelivr.net/npm/live2d-widget@3.x/lib/L2Dwidget.min.js"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"https://cdn.jsdelivr.net/npm/live2d-widget-model-hijiki@1.0.5/assets/hijiki.model.json"},"display":{"superSample":2,"width":160,"height":320,"position":"right","hOffset":0,"vOffset":-70},"mobile":{"show":false,"scale":0.2},"log":false});</script></body>
</html>
